<template>
  <div>
    <template v-if="listData.length">
      <el-row :gutter="24">
        <el-col class="mb20" :span="8" v-for="(item,index) in listData" :key="index">
          <el-card shadow="hover">
            <div class="tl-center mb10">
              <el-image v-viewer alt="example" :src="item.url" fit="cover" />
              <span>上传时间：{{ formatTime(item.submitTime) }}</span>
              <span>上传人： {{ item.submitUser }}</span>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </template>
    <template v-else>
      <empty-comp ref="emptyComp" />
    </template>
  </div>
</template>

<script>
import { getSession } from '@/utils/util'
import { queryHistoryPic } from '@/api/assetsNew'

export default {
  data() {
    return {
      listData: []
    }
  },
  methods: {
    async edit(obj) {
      this.mdl = Object.assign({}, obj)
      const res = await queryHistoryPic({ assetsId: obj.assetsId })
      console.log('res', res.data)
      if (res.data && res.data.length > 0) {
        this.listData = res.data
      } else {
        this.listData = []
      }
    }
  }
}
</script>

